//
//  FlutterPluginStream.m
//  xfspeech
//
//  Created by 创屹研发 on 2021/12/8.
//

#import "FlutterPluginStream.h"

@implementation FlutterPluginStream

+ (instancetype)sharedInstance {
    static dispatch_once_t onceToken;
    static FlutterPluginStream *manager = nil;
    dispatch_once(&onceToken, ^{
        manager = [[FlutterPluginStream alloc] init];
        FlutterPluginStreamHandler * streamHandler = [[FlutterPluginStreamHandler alloc] init];
        manager.streamHandler = streamHandler;
    });

    return manager;
}

@end

@implementation FlutterPluginStreamHandler

- (FlutterError*)onListenWithArguments:(id)arguments eventSink:(FlutterEventSink)eventSink {
    self.eventSink = eventSink;
    return nil;
}

- (FlutterError*)onCancelWithArguments:(id)arguments {
    self.eventSink = nil;
    return nil;
}

@end
